function execute()
    %fileNames  = {'barco.pgm','circulo.pgm','const.pgm','degrade1.pgm','fractal.pgm','girl2.pgm','girl.pgm','lena.pgm','lenacontraste.pgm','lenacontrasteFourier.pgm','lenaFourier.pgm','lenalines.pgm','lenalinesfourier.pgm','lenaRB.pgm','muestra.pgm','nadarb.pgm','puntosAislados.pgm','rect_diag.pgm','rect_diag_inv.pgm','rectS&P.pgm'};
    fileNames  = {'test.pgm','triangulo.pgm'};
    [n,m] = size(fileNames);
    for I = 1:m
        fn = char(fileNames(I));
        comprimirFrom(60,-5,5,fn);
        comprimirFrom(5,-1,0,fn);
    end
    
    function comprimirFrom(desde,sumar,hasta,fn)
        j = 1;
        for k = desde: sumar : hasta
            [A1,e1] = comprimir(fn,k);
            valK(j) = k;
            result(j) = e1;
            j = j + 1;
        end
        saveGraphic(valK, result, fn, k, desde, hasta);
    
    function saveGraphic(valK, result, fn, k, desde, hasta)
        h = figure;
        plot(valK, result);
        result
        title('ecm vs k');
        xlabel('k');
        ylabel('error');
        axis ([hasta desde min(result) max(result)]);
        if min(result) == max(result)
            axis ([hasta desde hasta desde]);
        end
        if k == 5 
            name = regexprep(fn,'.pgm','Graph.png');
        else
            name = regexprep(fn,'.pgm','Graph5.png');
        end
        saveas(h,name);